<!DOCTYPE html  >
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<script src="/js/task_view.js"></script>
<head th:include="/base/common_css('test')">

<body>
<div th:include="/base/common_banner"></div>

<!-- Header ends -->
<!-- Main content starts -->

<div class="content">

    <!-- Sidebar -->
    <!--menu ????-->
    <div th:include="/base/common_menu"></div>
    <!--menu????-->
    <!-- Sidebar ends -->

    <!-- Main bar -->
    <div class="mainbar">

        <!-- Page heading -->
        <div th:include="/base/common_pageHeader"></div>
        <!-- Page heading ends -->

        <div class="matter">
            <div class="container">
                <div class="row">

                    <div class="col-md-12">
                        <div class="widget">
                            <div class="widget-head">
                                <div class="pull-left">礼包管理</div>
                                <div class="">
                                    <div class="widget-icons pull-right">
                                        <button onclick="toTaskInfo('/view/task/toTaskInfo','')"
                                                class="btn btn-primary">新增
                                        </button>
                                    </div>
                                </div>
                                <div class="clearfix"></div>
                            </div>

                            <div class="widget-content medias" style="table-layout:fixed">
                                <div class="padd">
                                    <form class="form-horizontal" method="get">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label" style="width: 110px;"> 礼包类型
                                            </label>
                                            <div class="col-sm-2">
                                                <select id="giftType" class="selectpicker show-tick form-control">
                                                    <option th:each="giftTypes:${giftTypeMap}"
                                                            th:value="${giftTypes.key}"
                                                            th:text="${giftTypes.value}"
                                                            th:selected="${giftTypes.key == giftType}"></option>
                                                </select>
                                            </div>


                                            <label class="col-sm-2 control-label" style="width: 110px;"> 礼包状态
                                            </label>
                                            <div class="col-sm-2">
                                                <select id="status" class="selectpicker show-tick form-control">
                                                    <option th:each="giftStatu:${giftStatusMap}"
                                                            th:value="${giftStatu.key}"
                                                            th:text="${giftStatu.value}"
                                                            th:selected="${giftStatu.key == giftStatus}"></option>
                                                </select>
                                            </div>

                                            <label class="col-sm-2 control-label" style="width: 110px;"> 结果排序
                                            </label>
                                            <div class="col-sm-1">
                                                <select id="resultSort" class="selectpicker show-tick form-control">
                                                    <option th:each="resultSorts:${resultSortMap}"
                                                            th:value="${resultSorts.key}"
                                                            th:text="${resultSorts.value}"
                                                            th:selected="${resultSorts.key == resultSort}"></option>
                                                </select>
                                            </div>
                                            <div class="col-sm-1">
                                                <select id="orderType" class="selectpicker show-tick form-control">
                                                    <option th:each="orderTypes:${orderTypeMap}"
                                                            th:value="${orderTypes.key}"
                                                            th:text="${orderTypes.value}"
                                                            th:selected="${orderTypes.key == orderType}"></option>
                                                </select>
                                            </div>

                                            <div class="widget-icons ">
                                                <button type="button" onclick="search('/view/task/searchTaskList');"
                                                        class="btn btn-primary">搜索
                                                </button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="matter">
            <div class="container">
                <div class="row">

                    <div class="col-md-12">

                        <div class="widget">

                            <div class="widget-head ">
                                <div class="pull-left">礼包信息 &nbsp;&nbsp;&nbsp;&nbsp;</div>
                                <div class="clearfix ">
                                    <div class="widget-icons ">
                                        <button type="button"
                                                onclick="batchUpdate('/view/task/updateBatch','task_table',1);"
                                                class="btn btn-primary">显示
                                        </button>
                                        <button type="button"
                                                onclick="batchUpdate('/view/task/updateBatch','task_table',0);"
                                                class="btn btn-primary">隐藏
                                        </button>
                                    </div>
                                </div>
                            </div>

                            <div class="widget-content medias">
                                <table border="1" style="table-layout:fixed" id="task_table"
                                       class="table table-condensed table-bordered table-hover table-striped">
                                    <thead>
                                    <tr>
                                        <th>
                                        <span class="uni">
                                          <input type='checkbox' onclick="batchSelect(this,'task_table')"/>全选
                                        </span>
                                        </th>
                                        <th>序号</th>
                                        <th>礼包类型</th>
                                        <th>礼包名称</th>
                                        <th>礼包描述</th>
                                        <th>领取条件</th>
                                        <th>重置周期</th>
                                        <th>奖励</th>
                                        <th>状态</th>
                                        <th>创建时间</th>
                                        <th>操作</th>
                                    </tr>
                                    <tr th:each="obj,objStat:${taskInfoList.list}">
                                        <th>
                                            <span class="uni">
                                              <input type='checkbox' th:name="${obj.id}"/>
                                            </span>
                                        </th>
                                        <td th:text="${obj.taskOrder}"></td>
                                        <td th:switch="${obj.giftType}">
                                            <p th:case="1">签到礼包</p>
                                            <p th:case="2">每日礼包</p>
                                        </td>
                                        <td th:text="${#strings.abbreviate(obj.giftName,10)}"></td>
                                        <td th:text="${obj.taskDesc}"></td>
                                        <td th:switch="${obj.requireType}">
                                            <p th:case="1">邀请</p>
                                            <p th:case="2">点赞</p>
                                            <p th:case="3">评论</p>
                                            <p th:case="4">分享</p>
                                            <p th:case="5">连续登陆</p>
                                            <p th:case="6">Lv</p>
                                            <p th:case="7">签到累计</p>
                                        </td>
                                        <td th:switch="${obj.resetDays}">
                                            <p th:case="1">每日</p>
                                            <p th:case="7">每周</p>
                                            <p th:case="30">每月</p>
                                        </td>
                                        <td>
                                            <!--礼包1-->
                                            <font th:text="${obj.prizeCount1}">
                                            </font>
                                            <font th:switch="${obj.prizeType1}">
                                                <font th:case="1">G币,</font>
                                                <font th:case="2">Exp,</font>
                                                <font th:case="3">礼物,</font>
                                                <font th:case="4">道具,</font>
                                            </font>
                                            <!--礼包2-->
                                            <font th:text="${obj.prizeCount2}"></font>
                                            <font th:switch="${obj.prizeType2}">
                                                <font th:case="1">G币,</font>
                                                <font th:case="2">Exp,</font>
                                                <font th:case="3">礼物,</font>
                                                <font th:case="4">道具,</font>
                                            </font>
                                            <!--礼包3-->
                                            <font th:text="${obj.prizeCount3}"></font>
                                            <font th:switch="${obj.prizeType3}">
                                                <font th:case="1">G币,</font>
                                                <font th:case="2">Exp,</font>
                                                <font th:case="3">礼物,</font>
                                                <font th:case="4">道具,</font>
                                            </font>

                                        </td>
                                        <td th:switch="${obj.status}">
                                            <p th:case="0">隐藏</p>
                                            <p th:case="1">显示</p>
                                        </td>
                                        <td th:text="${#dates.format(obj.createTime, 'yyyy-MM-dd')}"></td>
                                        <td>
                                            <button th:onclick="'javascript:toTaskInfo(\'/view/task/toTaskInfo\',\''+ ${obj.id}+'\')'"
                                                    class="btn btn-success">修改
                                            </button>
                                            <!--<a th:href="@{'/view/task/toTaskInfo?taskId='+${obj.id}}"-->
                                            <!--class="btn btn-success">修改</a>&nbsp;&nbsp;&nbsp;-->
                                            <!--<a th:href="@{'/view/task/removeTaskInfo?taskId='+${obj.id}}"-->
                                            <!--class="btn btn-danger">隐藏</a>-->
                                        </td>
                                    </tr>
                                    </thead>
                                </table>


                                <!--分页-->
                                <div class="widget-foot">
                                    <div id="page1">
                                        <input type="hidden" id="pageNumber" th:value="${taskInfoList.pageNum}">
                                        <input type="hidden" id="pageSize" th:value="${taskInfoList.pageSize}">
                                        <input type="hidden" id="totalPage" th:value="${taskInfoList.pages}">
                                        <input type="hidden" id="total" th:value="${taskInfoList.total}">
                                    </div>
                                </div>


                                <div class="clearfix"></div>
                            </div>
                        </div>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<!--footer-->
<div th:include="/base/common_footer"></div>
<!---->


<!-- Scroll to top -->
<span class="totop"><a href="#"><i class="icon-chevron-up"></i></a></span>

<!--js????-->
<div th:include="/base/common_js"></div>
<!--js????-->

<!-- Script for this page -->
<script type="text/javascript">
    initPage('page1', '/view/task/searchTaskList', function () {
        return {
            'giftType': $('#giftType').val(),
            'status': $('#status').val(),
            'resultSort': $('#resultSort').val(),
            'orderType': $('#orderType').val()
        };
    }, false);


</script>

</body>
</html>
